(ns clj-gallery.utils.auth
  (:require [buddy.auth.accessrules :as buddy]))

(defmacro restrict-1 [rule & body]
  (let [n (symbol "$req")]
    `(buddy/restrict (fn [~n] ~@body) ~rule)))

(comment
  (use 'clojure.pprint)
  (pprint (macroexpand-1 '(restrict-1 {:handler (operator-access :macro)}
                            "buddy with macro"))))